﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PostSharp.Laos;

namespace EntityFrameworkContrib.PostSharp4EF
{
    /// <summary>
    /// Hooks the instance up to the implementation object
    /// </summary>
    [Serializable]
	public class RelationshipLoaderSubAspect : CompositionAspect
	{

        public override object CreateImplementationObject(InstanceBoundLaosEventArgs eventArgs)
        {
            return new RelationshipLoaderImplementation(eventArgs.Instance);
        }

        public override Type GetPublicInterface(Type containerType)
        {
            return typeof(IRelationshipLoader);
        }

        
        public override CompositionAspectOptions GetOptions()
        {
            // no need to implement if base class has it
            return CompositionAspectOptions.IgnoreIfAlreadyImplemented;
        }
    }
}
